/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author HuyNVK
 */
@Entity
@Table(name = "PROJECTSTATUS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Projectstatus.findAll", query = "SELECT p FROM Projectstatus p"),
    @NamedQuery(name = "Projectstatus.findByProjectStatusID", query = "SELECT p FROM Projectstatus p WHERE p.projectStatusID = :projectStatusID"),
    @NamedQuery(name = "Projectstatus.findByName", query = "SELECT p FROM Projectstatus p WHERE p.name = :name"),
    @NamedQuery(name = "Projectstatus.findByDescription", query = "SELECT p FROM Projectstatus p WHERE p.description = :description")})
public class Projectstatus implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ProjectStatusID")
    private String projectStatusID;
    @Basic(optional = false)
    @Column(name = "Name")
    private String name;
    @Column(name = "Description")
    private String description;
    @OneToMany(mappedBy = "statusID")
    private Collection<Project> projectCollection;

    public Projectstatus() {
    }

    public Projectstatus(String projectStatusID) {
        this.projectStatusID = projectStatusID;
    }

    public Projectstatus(String projectStatusID, String name) {
        this.projectStatusID = projectStatusID;
        this.name = name;
    }

    public String getProjectStatusID() {
        return projectStatusID;
    }

    public void setProjectStatusID(String projectStatusID) {
        this.projectStatusID = projectStatusID;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @XmlTransient
    public Collection<Project> getProjectCollection() {
        return projectCollection;
    }

    public void setProjectCollection(Collection<Project> projectCollection) {
        this.projectCollection = projectCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (projectStatusID != null ? projectStatusID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Projectstatus)) {
            return false;
        }
        Projectstatus other = (Projectstatus) object;
        if ((this.projectStatusID == null && other.projectStatusID != null) || (this.projectStatusID != null && !this.projectStatusID.equals(other.projectStatusID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.Projectstatus[ projectStatusID=" + projectStatusID + " ]";
    }
    
}
